package com.plsData.data;

import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

public abstract class Data {

	private final static String dbUrl = "jdbc:mysql://localhost:3306/pls";
	private final static String user = "root";
	private final static String password = "password";
	private final static String driver = "com.mysql.jdbc.Driver";
	
	protected Connection getConnection() {
		Connection conn = null;

		try {
			// load driver class
			// if you are using any other database then load the driver here
			Class.forName(driver);
			// create the connection string using the static getConnection
			// method
			// change the connection string according to your db, ip, username
			// and password
			conn = DriverManager.getConnection(dbUrl, user, password);
		} catch (SQLException ex) {
			ex.printStackTrace();
		} catch (ClassNotFoundException ex) {
			ex.printStackTrace();
		}
		return conn;

	}

}
